home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Floppyshop 2
/
Floppyshop - 2.zip
/
Floppyshop - 2.iso
/
art&graf.ix
/
art-3139
/
boot_pic.mug
/
install.s
< prev
next >
Wrap
Text File
|
1987-04-21
|
2KB
|
111 lines
;--------------------------------------------------
; Bootsector Installer by MUG U.K for personal use
;--------------------------------------------------
;
; Go to the end of this source code and press 'Alt' & 'I' to insert
; some new bootsector code
;
;
* Ask which drive is to be protected
guard pea guardmess
move.w #$09,-(sp)
trap #1
addq.l #6,sp
* Wait for the 'a', 'b' and 'esc' keys.
_kloop move.w #$07,-(sp)
trap #1
addq.l #2,sp
swap d0
cmp.b #1,d0 ESC key
beq.s _exit
cmp.b #$1e,d0 'a' key
beq.s guarda
cmp.b #$30,d0 'b' key
bne.s _kloop
guardb move.w #1,guarddrv+2
bra.s do_guard
guarda clr.w guarddrv+2
do_guard pea guardclr Display 'Writing'
move.w #$09,-(sp)
trap #1
addq.l #6,sp
* Read the current bootsector and insert the main data into ours
bsr.s read
move.w #29,d0
lea mybuffer,a1
lea bootbuffer,a0
cloop1 move.b (a0)+,(a1)+
dbf d0,cloop1
move.w #$601c,mybuffer ; Add BSR code
* Calculate new checksum
lea mybuffer,a0 My bootsector
clr.w d7 Clear checksum count
clr.w $1fe(a0) In buffer as well
move.w #$ff,d5
calop add.w (a0)+,d7 Make checksum in D7
dbf d5,calop
move.w #$1234,d0
sub.w d7,d0
move.w d0,$1fe+mybuffer
bsr.s write
bra guard
_exit clr.w -(sp)
trap #1
* Subroutines to read and write the bootsector
read move.w #$08,d0
lea bootbuffer,a0
bra.s perform
write move.w #$09,d0
lea mybuffer,a0
perform move.w #$01,-(sp) Read 1 sector
clr.w -(sp) Side 0
clr.w -(sp) Track 0
move.w #$01,-(sp) Sector 1
guarddrv move.w #0,-(sp) Drive A
clr.l -(sp) Filler
move.l a0,-(sp) Address of buffer
move.w d0,-(sp) Floprd/flopwr
trap #14
add.l #20,sp
rts
guardmess dc.b 27,"EInsert Disk To Be Installed.",13,10,10
dc.b "Press 'A' to write to the disk in drive A",13,10
dc.b " 'B' to write to the disk in drive B",13,10
dc.b " 'ESC' to abort.",0
guardclr dc.b 13,10,10,10
dc.b "Writing ... Please Wait",0
even
* 512 byte buffer for bootsector read from disk
bootbuffer ds.b 512
* Pre constructed boot sector minus statistics
bootst
mybuffer ds.b 30
* Insert the bootsector source of your choice after 'bootcode'
bootcode